<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">

	<title>DWUploader Class Reference</title>

	<link rel="stylesheet" href="../css/style.css">
	<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
	<meta name="generator" content="appledoc 2.2.1 (build 1334)">
</head>
<body class="appledoc">
	<header>
		<div class="container" class="hide-in-xcode">
			
			<h1 id="library-title">
				<a href="../index.html">CCSDK2.3.11 </a>
			</h1>

			<p id="developer-home">
				<a href="../index.html">cc</a>
			</p>
			
		</div>
	</header>

	<aside>
		<div class="container">
			<nav>
				<ul id="header-buttons" role="toolbar">
					<li><a href="../index.html">Index</a></li>
<li><a href="../hierarchy.html">Hierarchy</a></li>

					<li id="on-this-page" role="navigation">
						<label>
							On This Page

							<div class="chevron">
								<div class="chevy chevron-left"></div>
								<div class="chevy chevron-right"></div>
							</div>

							<select id="jump-to">
	<option value="top">Jump To&#133;</option>
	

	
	
	<option value="tasks">Tasks</option>
	
	

	
	
	<optgroup label="Properties">
		
		<option value="//api/name/failBlock">failBlock</option>
		
		<option value="//api/name/finishBlock">finishBlock</option>
		
		<option value="//api/name/pausedBlock">pausedBlock</option>
		
		<option value="//api/name/progressBlock">progressBlock</option>
		
		<option value="//api/name/timeoutSeconds">timeoutSeconds</option>
		
		<option value="//api/name/uploadBufferSize">uploadBufferSize</option>
		
		<option value="//api/name/videoContextForRetryBlock">videoContextForRetryBlock</option>
		
	</optgroup>
	

	

	
	<optgroup label="Instance Methods">
		
		<option value="//api/name/category:">- category:</option>
		
		<option value="//api/name/initWithUserId:andKey:uploadVideoTitle:videoDescription:videoTag:videoPath:notifyURL:">- initWithUserId:andKey:uploadVideoTitle:videoDescription:videoTag:videoPath:notifyURL:</option>
		
		<option value="//api/name/initWithVideoContext:">- initWithVideoContext:</option>
		
		<option value="//api/name/pause">- pause</option>
		
		<option value="//api/name/resume">- resume</option>
		
		<option value="//api/name/start">- start</option>
		
	</optgroup>
	
	
</select>
						</label>
					</li>
				</ul>
			</nav>
		</div>
	</aside>

	<article>
		<div id="overview_contents" class="container">
			<div id="content">
				<main role="main">
					<h1 class="title">DWUploader Class Reference</h1>

					
					<div class="section section-specification"><table cellspacing="0"><tbody>
						<tr>
	<th>Inherits from</th>
	<td>NSObject</td>
</tr><tr>
	<th>Declared in</th>
	<td>DWUploader.h<br />DWUploader.m</td>
</tr>
						</tbody></table></div>
					

                    

					
					
					<div class="section section-tasks">
						<a title="Tasks" name="tasks"></a>
						

						
						<h2 class="task-title">Other Methods</h2>

						<div class="task-list">
							<div class="section-method">
	<a name="//api/name/timeoutSeconds" title="timeoutSeconds"></a>
	<h3 class="method-title"><code><a href="#//api/name/timeoutSeconds">&nbsp;&nbsp;timeoutSeconds</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>上传过程中HTTP通信请求超时时间</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (assign, nonatomic) NSTimeInterval timeoutSeconds</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWUploader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/progressBlock" title="progressBlock"></a>
	<h3 class="method-title"><code><a href="#//api/name/progressBlock">&nbsp;&nbsp;progressBlock</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>在该block获取上传进度，可以在block内更新UI，如更新上传进度条。</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (copy, nonatomic) DWUploaderProgressBlock progressBlock</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWUploader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/finishBlock" title="finishBlock"></a>
	<h3 class="method-title"><code><a href="#//api/name/finishBlock">&nbsp;&nbsp;finishBlock</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>上传完成时回调该block，可以在block内更新UI，如将视频标记为上传完成。</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (copy, nonatomic) DWUploaderFinishBlock finishBlock</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWUploader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/failBlock" title="failBlock"></a>
	<h3 class="method-title"><code><a href="#//api/name/failBlock">&nbsp;&nbsp;failBlock</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>上传失败时回调该block，可以在该block内更新UI，如将视频标记为上传失败。</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (copy, nonatomic) DWErrorBlock failBlock</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWUploader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/videoContextForRetryBlock" title="videoContextForRetryBlock"></a>
	<h3 class="method-title"><code><a href="#//api/name/videoContextForRetryBlock">&nbsp;&nbsp;videoContextForRetryBlock</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>在该block内获取上传上下文，并保存上传上下文，用来实现断线续传。</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (copy, nonatomic) DWUploaderVideoContextForRetryBlock videoContextForRetryBlock</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWUploader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/pausedBlock" title="pausedBlock"></a>
	<h3 class="method-title"><code><a href="#//api/name/pausedBlock">&nbsp;&nbsp;pausedBlock</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>当遇到网络问题或服务器原因时上传暂停，回调该block。</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (copy, nonatomic) DWErrorBlock pausedBlock</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWUploader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/initWithUserId:andKey:uploadVideoTitle:videoDescription:videoTag:videoPath:notifyURL:" title="initWithUserId:andKey:uploadVideoTitle:videoDescription:videoTag:videoPath:notifyURL:"></a>
	<h3 class="method-title"><code><a href="#//api/name/initWithUserId:andKey:uploadVideoTitle:videoDescription:videoTag:videoPath:notifyURL:">&ndash;&nbsp;initWithUserId:andKey:uploadVideoTitle:videoDescription:videoTag:videoPath:notifyURL:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>初始化上传对象</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (id)initWithUserId:(NSString *)<em>userId</em> andKey:(NSString *)<em>key</em> uploadVideoTitle:(NSString *)<em>title</em> videoDescription:(NSString *)<em>description</em> videoTag:(NSString *)<em>videoTag</em> videoPath:(NSString *)<em>videoPath</em> notifyURL:(NSString *)<em>notifyURL</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>userId</code></th>
						<td><p>用户ID，不能为nil</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>key</code></th>
						<td><p>用户秘钥，不能为nil</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>title</code></th>
						<td><p>视频标题，不能为nil</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>description</code></th>
						<td><p>视频描述</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>videoTag</code></th>
						<td><p>视频标签</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>videoPath</code></th>
						<td><p>视频路径，不能为nil</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>notifyURL</code></th>
						<td><p>通知URL</p></td>
					</tr>
				
				</table>
			</div>
			

			
			<div class="method-subsection return">
				<h4 class="method-subtitle parameter-title">Return Value</h4>
				<p>上传对象</p>
			</div>
			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWUploader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/initWithVideoContext:" title="initWithVideoContext:"></a>
	<h3 class="method-title"><code><a href="#//api/name/initWithVideoContext:">&ndash;&nbsp;initWithVideoContext:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>重新初始化上传对象</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (id)initWithVideoContext:(NSDictionary *)<em>videoContext</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>videoContext</code></th>
						<td><p>通过 videoContextTryBlock 获取的视频上传上下文。
使用该方法重新初始化 uploader，调用 <a href="#//api/name/resume">resume</a> 方法继续上传。</p>

<p>如果 videoContextTryBlock 未调用，则需要通过 initWithUserId:&hellip; 方法重新初始化对象，调用 <a href="#//api/name/start">start</a> 重新上传。</p></td>
					</tr>
				
				</table>
			</div>
			

			
			<div class="method-subsection return">
				<h4 class="method-subtitle parameter-title">Return Value</h4>
				<p>成功返回上传对象，如果 videoContext 无效，则初始化失败，返回nil。</p>
			</div>
			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWUploader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/start" title="start"></a>
	<h3 class="method-title"><code><a href="#//api/name/start">&ndash;&nbsp;start</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>开始上传</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)start</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWUploader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/pause" title="pause"></a>
	<h3 class="method-title"><code><a href="#//api/name/pause">&ndash;&nbsp;pause</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>暂停上传</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)pause</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWUploader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/resume" title="resume"></a>
	<h3 class="method-title"><code><a href="#//api/name/resume">&ndash;&nbsp;resume</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>继续上传</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)resume</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWUploader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/category:" title="category:"></a>
	<h3 class="method-title"><code><a href="#//api/name/category:">&ndash;&nbsp;category:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>分类上传</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)category:(NSString *)<em>categoryId</em></code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWUploader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div>
						</div>
						

						<a title="Extension Methods" name="task_Extension Methods"></a>
						<h2 class="task-title">Extension Methods</h2>

						<div class="task-list">
							<div class="section-method">
	<a name="//api/name/uploadBufferSize" title="uploadBufferSize"></a>
	<h3 class="method-title"><code><a href="#//api/name/uploadBufferSize">&nbsp;&nbsp;uploadBufferSize</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>上传过程中使用的buffer大小，默认4MB</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (assign, nonatomic) NSInteger uploadBufferSize</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<p>上传过程中使用的buffer大小，默认4MB</p>
			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWUploader.m</code></p>
			</div>
			
			
		</div>
	</div>
</div>
						</div>
						
					</div>
					
					

                    
                    
          
				</main>

				<footer>
					<div class="footer-copyright">
						
						<p class="copyright">Copyright &copy; 2015 cc. All rights reserved. Updated: 2015-11-10</p>
						
						
						<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
						
					</div>
				</footer>
			</div>
		</div>
	</article>

	<script src="../js/script.js"></script>
</body>
</html>